# app/__init__.py
import os
from flask import Flask

class Config:
    # 基础配置
    # SECRET_KEY = 'your-secret-key'
    # 静态模板文件路径
    TEMPLATES_FOLDER = os.path.join(os.path.dirname(__file__), 'templates')
    # 静态样式文件路径
    STATIC_FOLDER = os.path.join(os.path.dirname(__file__), 'static')

def create_app(config_class=Config):
    app = Flask(__name__)
    app.config.from_object(config_class)

    # 设置模板和静态文件夹
    app.template_folder = app.config['TEMPLATES_FOLDER']
    app.static_folder = app.config['STATIC_FOLDER']

    return app